
package com.travelsmart.client.apresentacao.screen;

import java.util.List;
import com.travelsmart.client.apresentacao.controller.CommandController;
import com.travelsmart.client.apresentacao.controller.Observer;
import com.travelsmart.client.apresentacao.i18n.I18nMessages;
import com.travelsmart.client.apresentacao.view.ViewInfoReservaHotel;
import com.travelsmart.client.apresentacao.view.ViewListaReservaHotel;
import com.travelsmart.client.apresentacao.widget.FormDialogBox;
import com.travelsmart.client.bean.to.ReservaHotelTO;

public class ConsultarReservasHotelScreen extends BaseScreen implements Observer{

	private ViewInfoReservaHotel viewInfoReservaHotel;
	private ViewListaReservaHotel viewListaReservaHotel;
	private CommandController<Integer> handlerShowPage;
	
	public ConsultarReservasHotelScreen (CommandController<Integer> handlerShowPage, ViewListaReservaHotel viewListaReservaHotel, ViewInfoReservaHotel viewInfoReservaHotel){
		this.handlerShowPage = handlerShowPage;
		this.viewListaReservaHotel = viewListaReservaHotel;
		this.viewInfoReservaHotel = viewInfoReservaHotel;
		super.panelScreen.add(viewListaReservaHotel);
	}
		
	public void exec(){
		this.handlerShowPage.handleSuccess(0);
	}

	public ViewListaReservaHotel getViewListaReservaHotel() {
		return viewListaReservaHotel;
	}


	@Override
	public void update(Object arg) {
		if(arg instanceof List){
			onLoad();
		}else if(arg instanceof ReservaHotelTO){
			
			final FormDialogBox meuDialogBox = new FormDialogBox(null, I18nMessages.INSTANCE.detalhes_reserva(), viewInfoReservaHotel);
			meuDialogBox.show();
		
		
		}
	}
}
